<div class="row-content am-cf" ng-controller="adControl">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf">广告统计</div>
                </div>
                <div class="widget-body am-fr">
                    <!-- 工具栏 -->
                     <div class="page_toolbar am-margin-bottom am-cf">
                        <form class="toolbar-form" action="">
                            <!--<input type="hidden" name="s" value="/<?= $request->pathinfo() ?>">-->
                            <div class="am-u-sm-12 am-u-md-9 am-u-sm-push-3">
                                <div class="am fr">
                                    <div class="am-form-group am-fl">
                                        <?php $date = $request->get('date'); ?>
                                        <input type="text" class="am-form-field" placeholder="日历组件" data-am-datepicker required  id="adDate" value="<?=isset($date) && !empty($date) ? date('Y-m-d',$date) : date('Y-m-d',time())?>"/>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="am-scrollable-horizontal am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped
                         tpl-table-black am-text-nowrap">
                            <thead>
                            <tr>
                                <th>记录ID</th>
                                <th width="20%">广告名称</th>
                                <th>APPID</th>
                                <th>跳转总计</th>
                                <th>跳转人数</th>
                                <th>创建时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
                                <tr>
                                    <td class="am-text-middle"><?= $item['id'] ?></td>
                                    <td class="goods-detail am-text-middle"><?=$item['jump_ads_name']?></td>
                                    <td class="am-text-middle"><?=$item['jump_ads_appid']?></td>
                                    <td class="am-text-middle"><?=$item['total'] ?></td>
                                    <td class="am-text-middle"><?=$item['number'] ?></td>
                                    <td class="am-text-middle"><?=date('Y-m-d',$item['date'])?></td>
                                </tr>
                            <?php endforeach; else: ?>
                                <tr>
                                    <td colspan="10" class="am-text-center">暂无记录</td>
                                </tr>
                            <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr"><?= $list->render() ?> </div>
                        <div class="am-fr pagination-total am-margin-right">
                            <div class="am-vertical-align-middle">总记录：<?= $list->total() ?></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
   
</div>

<script src="https://cdn.bootcss.com/angular.js/1.7.9/angular.min.js"></script>
<script src="assets/common/plugins/layer/layer.js"></script>
<script>
	var app = angular.module('app', []);
	app.controller('adControl', ['$scope','$http',function($scope,$http) {
		$scope.search = {}; // 保存的数据
		
		$('#adDate').datepicker().on('changeDate.datepicker.amui', function(event) {
			// console.log(new Date(event.date))
			// console.log(parseInt(new Date(event.date) / 1000))
			$(this).datepicker('close');
			return window.location.href = window.location.origin+'/index.php?s=/store/apps.bargain.ad/index&date='+parseInt(new Date(event.date) / 1000);
		});
	}]);
</script>

